package Tiles
{
	import Graphics.TileSet;
	
	import Utils.Collision;
	
	import flash.geom.Rectangle;
	
	public class Tile extends GameObject
	{		
		public function Tile(game:Level, index:int, tileSet:TileSet, width:int, height:int, visible:Boolean = true)
		{
			super( game);
			this.tileSet = tileSet;
			this.width = width;
			this.height = height;
			this.allowCollision = Collision.FLOOR;
			this.blitRectangle =  new Rectangle(int(index % tileSet.Row) * width, int(index / tileSet.Row) * height, width, height);
			isMoveable = false;
		}
		
		public function get Rect():Rectangle { return new Rectangle(worldPosition.x, worldPosition.y, 64,64);}
	}
}